﻿<paging:MtPage x:Name="PageRoot"
               x:Class="SampleWindowsStoreApp.Views.MtListBoxPage"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
               xmlns:paging="using:MyToolkit.Paging"
               xmlns:viewModels="using:SampleWindowsStoreApp.ViewModels"
               xmlns:controls="using:MyToolkit.Controls"
               mc:Ignorable="d">

    <paging:MtPage.Resources>
        <viewModels:DataGridPageModel x:Key="ViewModel" />
    </paging:MtPage.Resources>
    
    <Grid DataContext="{StaticResource ViewModel}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Button Margin="39,59,39,0" Command="{Binding Frame.GoBackCommand, ElementName=PageRoot}"
                    Style="{StaticResource NavigationBackButtonNormalStyle}" VerticalAlignment="Top"
                    AutomationProperties.Name="Back" AutomationProperties.AutomationId="BackButton" 
                    AutomationProperties.ItemType="Navigation Button"/>

            <TextBlock Style="{StaticResource SubheaderTextStyle}" Text="Windows 8 and MyToolkit Sample App" Margin="0,50,0,10" Grid.Column="1" />
        </Grid>

        <Grid Grid.Row="1" Margin="120,0,40,40">
            <controls:MtListBox x:Name="MtListBox" ScrolledToEnd="OnScrolledToEnd" 
                                InnerMargin="40" BorderThickness="1" BorderBrush="Red">
                <controls:MtListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" Foreground="White" />
                    </DataTemplate>
                </controls:MtListBox.ItemTemplate>
            </controls:MtListBox>
        </Grid>
    </Grid>
</paging:MtPage>
